<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Web高级开发 | Advanced Web Development Course</title>
    <link href="https://fonts.googleapis.com/css?family=Heebo:300,400" rel="stylesheet" />
    <link rel="stylesheet" href="../../css/main.css" />
    <link rel="stylesheet" href="../../css/tabs.css" />
    <script src="../../js/uikit.js"></script>
</head>

<body>
    <div data-uk-sticky="animation: uk-animation-slide-top; sel-target: .uk-navbar-container; cls-active: uk-navbar-sticky; cls-inactive: uk-navbar-transparent; top: 300">
        <nav class="uk-navbar-container pt-2 pb-2">
            <div class="uk-container">
                <div data-uk-navbar>
                    <div class="uk-navbar-left">
                        <a class="uk-navbar-item uk-logo uk-visible@m" href="../../index.html">Web高级开发课程</a>
                        <a class="uk-navbar-tuk-containeroggle uk-hidden@m" href="#offcanvas-docs" data-uk-toggle><span data-uk-navbar-toggle-icon></span>
                            <span class="uk-margin-small-left">目录</span></a>
                        <ul class="uk-navbar-nav uk-visible@m">
                            <li><a href="../../index.html">文档</a></li>
                        </ul>
                    </div>
                    <div class="uk-navbar-center uk-hidden@m">
                        <a class="uk-navbar-item uk-logo" href="../../index.html">Web高级开发课程</a>
                    </div>
                </div>
            </div>
        </nav>
    </div>

    <div class="uk-section">
        <div class="uk-container">
            <div class="uk-grid-large" data-uk-grid>
                <div class="sidebar-fixed-width uk-visible@m">
                    <div class="sidebar-docs uk-position-fixed uk-margin-top">
                        <h5>关于这门课</h5>
                        <ul class="uk-nav uk-nav-default doc-nav">
                            <li><a href="../../index.html">大纲</a></li>
                        </ul>
                        <h5>章节</h5>
                        <ul class="uk-nav uk-nav-default doc-nav">
                            <li><a href="../01.html">第1章 - Spring基础</a></li>
                            <li><a href="../02.html">第2章 - Spring中的Bean</a></li>
                            <li><a href="../03.html">第3章 - Spring AOP</a></li>
                            <li><a href="../04.html">第4章 - Spring的事物管理</a></li>
                            <li><a href="../05.html">第5章 - 初识MyBatis</a></li>
                            <li><a href="../06.html">第6章 - MyBatis的核心配置</a></li>
                            <li><a href="../07.html">第7章 - MyBatis的高级应用</a></li>
                            <li><a href="../08.html">第8章 - Spring MVC入门</a></li>
                            <li><a href="../09.html">第9章 - Spring MVC数据绑定</a></li>
                            <li><a href="../10.html">第10章 - Spring MVC拦截器</a></li>
                            <li><a href="../11.html">第11章 - Spring Boot基础</a></li>
                            <li><a href="../12.html">第12章 - Spring Boot的Web开发</a></li>
                            <li>
                                <a href="../13.html">第13章 - Spring Boot的数据库连接</a>
                            </li>
                            <li><a href="../14.html">第14章 - 框架整合</a></li>
                        </ul>
                        <h5>实验课</h5>
                        <ul class="uk-nav uk-nav-default doc-nav">
                            <li class="uk-active"><a href="./code-01.html">01</a></li>
                            <li><a href="./code-02.html">02</a></li>
                            <li><a href="./code-03.html">03</a></li>
                            <li><a href="./code-04.html">04</a></li>
                            <li><a href="./code-05.html">05</a></li>
                            <li><a href="./code-06.html">06</a></li>
                            <li><a href="./code-07.html">07</a></li>
                            <li><a href="./code-08.html">08</a></li>
                            <li><a href="./code-09.html">09</a></li>
                            <li><a href="./code-10.html">10</a></li>
                            <li><a href="./code-11.html">11</a></li>
                            <li><a href="./code-12.html">12</a></li>
                        </ul>
                    </div>
                </div>
                <div class="uk-width-1-1 uk-width-expand@m">
                    <article class="uk-article">
                        <h3>实验课内容</h3>
                        <div class="tabs">
                            <div class="tab-3">
                                <label for="tab3-1">开始</label>
                                <input id="tab3-1" name="tabs-three" type="radio" checked="checked" />
                                <div>
                                    <p>
                                        1. 双击 SpringToolSuite4 (应该在桌面上了，绿了吧唧的那个)
                                    </p>
                                    <p>
                                        2. 一顿操作 File --> New --> Project --> Spring Boot --> Spring Starter Project  --> Next 后看到下面的截图，
                                        <br>
                                        <img src="../../images/lab01/step-0-1.JPG" alt="step0-1" />
                                    </p>
                                    <p>
                                        3. 填写Name, Artifact 和 Package后点Next, 看到下面截图后点Finish。
                                        <img src="../../images/lab01/step-0-2.JPG" alt="step0-2" />
                                        <br>
                                        <br>
                                        (可能需要稍微一等，等右下角的进度条到100%了就好了)
                                        然后就可以玩耍了
                                    </p>
                                </div>
                            </div>
                            <div class="tab-3">
                                <label for="tab3-2">用xml配置的方法</label>
                                <input id="tab3-2" name="tabs-three" type="radio" />
                                <div>
                                    <p>
                                        1. 为项目使用<a href="../../files/applicationContext.xml">xml模板文件</a>
                                    </p>
                                    <p>2. 创建UserDao.java</p>
                                    <img src="../../images/lab01/code-step-1.JPG" alt="code-step-1" />
                                    <p>3. 创建UserDaoImpl.java, 并让其打印一段文字。</p>
                                    <img src="../../images/lab01/code-step-2.JPG" alt="code-step-2" />
                                    <p>4. xml文件内添加bean的配置</p>
                                    <img src="../../images/lab01/code-step-3.JPG" alt="code-step-3" />
                                    <p>xml文件放在resources目录下</p>
                                    <img src="../../images/lab01/code-step-3-2.JPG" alt="code-step-3-2" />
                                    <p>5. 创建Ioc.java文件(控制反转)</p>
                                    <img src="../../images/lab01/code-step-4.JPG" alt="code-step-4" />
                                    <p>6. 跑起来后打印如下</p>
                                    <img src="../../images/lab01/code-step-5.JPG" alt="code-step-5" />
                                    <p>7. 创建UserService.java</p>
                                    <img src="../../images/lab01/code-step-6.JPG" alt="code-step-6" />
                                    <p>8. 创建UserServiceImpl.java</p>
                                    <img src="../../images/lab01/code-step-7.JPG" alt="code-step-7" />
                                    <p>9. xml文件中添加注入</p>
                                    <img src="../../images/lab01/code-step-8.JPG" alt="code-step-8" />
                                    <p>10. 创建DI.java(依赖注入)</p>
                                    <img src="../../images/lab01/code-step-9.JPG" alt="code-step-9" />
                                    <p>11. 跑起来后打印如下</p>
                                    <img src="../../images/lab01/code-step-10.JPG" alt="code-step-10" />
                                </div>
                            </div>
                            <div class="tab-3">
                                <label for="tab3-3">用注解的方法</label>
                                <input id="tab3-3" name="tabs-three" type="radio" />
                                <div>
                                    <p>1. 创建UserDao.java</p>
                                    <img src="../../images/lab01/code-step-21.JPG" alt="code-step-21" />
                                    <p>2. 创建UserDao的实现类UserDaoImpl.java, 添加注解并让其打印一段文字。</p>
                                    <img src="../../images/lab01/code-step-22.JPG" alt="code-step-22" />
                                    <p>3. 创建UserService.java</p>
                                    <img src="../../images/lab01/code-step-23.JPG" alt="code-step-23" />
                                    <p>
                                        4. 
                                        <br>
                                        - 创建UserService的实现类UserServiceImpl.java, 添加注解。
                                        <br>
                                        - 然后再添加setter方法，通过@Resource注解的方式，为UserService注入UserDao
                                        <br>
                                        - 之后再login里打印一段文字
                                    </p>
                                    <img src="../../images/lab01/code-step-24.JPG" alt="code-step-24" />
                                    <p>5. 添加命名空间和context:component-scan到xml文件里
                                        <br>
                                        应用注解不是说xml文件就完全不要了，只不过是用注解比单纯用xml文件要省事一些
                                    </p>
                                    <img src="../../images/lab01/code-step-25.JPG" alt="code-step-25" />
                                    <p>6. 创建Main.java并在main方法里通过getBean的方式生成UserService对象
                                        <br>
                                        然后再调用UserService里的login方法
                                    </p>
                                    <img src="../../images/lab01/code-step-26.JPG" alt="code-step-26" />
                                    <p>7. 跑起来后能打印下面的内容就可以了</p>
                                    <img src="../../images/lab01/code-step-27.JPG" alt="code-step-27" />
                                </div>
                            </div>
                        </div>
                    </article>
                </div>
            </div>
        </div>
    </div>

    <div id="offcanvas-docs" data-uk-offcanvas="overlay: true">
        <div class="uk-offcanvas-bar">
            <button class="uk-offcanvas-close" type="button" data-uk-close></button>
            <h5 class="uk-margin-top">关于这门课</h5>
            <ul class="uk-nav uk-nav-default doc-nav">
                <li><a href="../indext.html">大纲</a></li>
            </ul>
            <h5 class="uk-margin-top">章节</h5>
            <ul class="uk-nav uk-nav-default doc-nav">
                <li><a href="../01.html">第1章 - Spring基础</a></li>
                <li><a href="../02.html">第2章 - Spring中的Bean</a></li>
                <li><a href="../03.html">第3章 - Spring AOP</a></li>
                <li><a href="../04.html">第4章 - Spring的事物管理</a></li>
                <li><a href="../05.html">第5章 - 初识MyBatis</a></li>
                <li><a href="../06.html">第6章 - MyBatis的核心配置</a></li>
                <li><a href="../07.html">第7章 - MyBatis的高级应用</a></li>
                <li><a href="../08.html">第8章 - Spring MVC入门</a></li>
                <li><a href="../09.html">第9章 - Spring MVC数据绑定</a></li>
                <li><a href="../10.html">第10章 - Spring MVC拦截器</a></li>
                <li><a href="../11.html">第11章 - Spring Boot基础</a></li>
                <li><a href="../12.html">第12章 - Spring Boot的Web开发</a></li>
                <li><a href="../13.html">第13章 - Spring Boot的数据库连接</a></li>
                <li><a href="../14.html">第14章 - 框架整合</a></li>
            </ul>
            <h5>实验课</h5>
            <ul class="uk-nav uk-nav-default doc-nav">
                <li class="uk-active"><a href="./code-01.html">01</a></li>
                <li><a href="./code-02.html">02</a></li>
                <li><a href="./code-03.html">03</a></li>
                <li><a href="./code-04.html">04</a></li>
                <li><a href="./code-05.html">05</a></li>
                <li><a href="./code-06.html">06</a></li>
                <li><a href="./code-07.html">07</a></li>
                <li><a href="./code-08.html">08</a></li>
                <li><a href="./code-09.html">09</a></li>
                <li><a href="./code-10.html">10</a></li>
                <li><a href="./code-11.html">11</a></li>
                <li><a href="./code-12.html">12</a></li>
            </ul>
        </div>
    </div>

    <footer class="uk-section uk-text-center uk-text-muted">
        <div class="uk-container uk-container-small">
            <div class="uk-margin-medium"></div>
        </div>
    </footer>

    <script src="../js/awesomplete.js"></script>
    <script src="../js/custom.js"></script>
</body>

</html>